home *** CD-ROM | disk | FTP | other *** search
- function INVOWNGT
- * I N V O W N G T
- * Routine to search out a customer
-
- parameters SEEKVAR
- private IVFUNC, OLDSCR
- private IVFLDS[4], IVHDRS[4]
-
- save screen to OLDSCR
- select INVOICE
-
- IVHDRS[1] = "Invoice"
- IVFLDS[1] = "INVNO"
- IVHDRS[2] = "Owner name"
- IVFLDS[2] = "OWNNAME"
- IVHDRS[3] = "Reg. No"
- IVFLDS[3] = "REGNO"
- IVHDRS[4] = "Date in"
- IVFLDS[4] = "DATEIN"
- set softseek on
- set deleted on
- * Determine which index we're using and set a low limit
- if eof() .or. empty(SEEKVAR)
- SEEKVAR = iif(isalpha(alltrim(SEEKVAR)) .or. empty(SEEKVAR),"!"," 1")
- seek SEEKVAR
- else && Position in middle of screen - maybe
- KOUNT = 5
- do while INVOICE->INVNO<>0 .and. KOUNT>0 .and. .not. bof()
- KOUNT = KOUNT - 1
- skip -1
- enddo
- keyboard replicate(chr(24),5-KOUNT)
- endif
-
- @ 7, 10,20,64 box replicate(chr(177),9)
- @ 8,12 clear to 19,62
-
- set color to (COLBRIGHT)
- do while .not. GETOUT
- do CTPRMT2
- DBEDIT(8,12,19,62,IVFLDS,"IVFUNC",.t.,IVHDRS,chr(196),chr(179))
- enddo
-
- GETOUT = .f.
- restore screen from OLDSCR
- return (MINVNO)
-
- ***********************************************************************
-
- function IVFUNC
- parameters MODE, FLD_PTR
- private CURREC, CURFLD, MEDSTR
- currec = recno()
- rowno=row()
- colno = col()
-
- QBKEY = lastkey()
- clear typeahead
- do case
- case MODE<4
- if INVOICE->INVNO=0
- keyboard chr(24)
- endif
- return 1
- case QBKEY=27
- store "" to MOWNNAME
- MINVNO = 0
- GETOUT = .t.
- return 0
- case QBKEY=13
- save screen
- CURFLD = IVFLDS[FLD_PTR]
- MEDSTR = INVOICE->&CURFLD
- set color to (COLFLASH)
- @ ROWNO, COLNO say MEDSTR
- if QBYESNO("Select this Invoice? (Y/N)")="Y"
- MINVNO = INVOICE->INVNO
- GETOUT = .t.
- return 0
- endif
- set color to (COLBRIGHT)
- restore screen
- otherwise
- clear typeahead
- do CTPRMT2
- return 1
- endcase
-
- return 0
-